Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres tests #760

Merged
merged 6 commits into from
Oct 13, 2023
Merged

Postgres tests #760

merged 6 commits into from
Oct 13, 2023

Conversation

harsh-98
Copy link
Contributor

@harsh-98 harsh-98 commented Sep 21, 2023

Description

Changes

  • Limit can't be negative for queries in postgres.
  • Change store test to use postgres.
  • Fixature for testing postgres/sqlite store test.
  • Add postgres module tests.
  • Based on driverType, NewQueries from sqlite/postgres should be used in waku_node.

Tests

@harsh-98 harsh-98 changed the title Postgres Postgres tests Sep 21, 2023
@harsh-98 harsh-98 self-assigned this Sep 21, 2023
@status-im-auto
Copy link

status-im-auto commented Sep 21, 2023

Jenkins Builds

Click to see older builds (51)
Commit #️⃣ Finished (UTC) Duration Platform Result
c01ca92 #1 2023-09-21 04:05:21 ~1 min linux 📄log
✖️ c01ca92 #1 2023-09-21 04:05:27 ~1 min nix-flake 📄log
✖️ c01ca92 #1 2023-09-21 04:06:55 ~2 min tests 📄log
✖️ c01ca92 #1 2023-09-21 04:07:20 ~3 min tests 📄log
✔️ c01ca92 #1 2023-09-21 04:08:35 ~4 min android 📦tgz
✔️ c01ca92 #1 2023-09-21 04:09:13 ~4 min ios 📦tgz
✖️ c01ca92 #2 2023-09-21 06:53:55 ~13 sec nix-flake 📄log
c01ca92 #2 2023-09-21 06:55:00 ~1 min linux 📄log
✖️ c01ca92 #2 2023-09-21 06:56:00 ~2 min tests 📄log
c01ca92 #3 2023-09-21 06:56:14 ~17 sec linux 📄log
✖️ c01ca92 #2 2023-09-21 06:56:35 ~3 min tests 📄log
✔️ c01ca92 #2 2023-09-21 06:57:08 ~3 min android 📦tgz
✔️ c01ca92 #2 2023-09-21 06:57:55 ~3 min ios 📦tgz
✖️ 6ea110a #3 2023-09-21 07:19:22 ~49 sec tests 📄log
✖️ 6ea110a #3 2023-09-21 07:19:36 ~1 min nix-flake 📄log
✖️ 6ea110a #3 2023-09-21 07:19:55 ~1 min tests 📄log
✔️ 6ea110a #4 2023-09-21 07:20:10 ~1 min linux 📦deb
✔️ 6ea110a #3 2023-09-21 07:21:48 ~3 min android 📦tgz
✔️ 6ea110a #3 2023-09-21 07:22:54 ~4 min ios 📦tgz
✖️ bff6b07 #4 2023-09-21 08:23:16 ~1 min nix-flake 📄log
✔️ bff6b07 #5 2023-09-21 08:23:16 ~1 min linux 📦deb
✖️ bff6b07 #4 2023-09-21 08:23:37 ~1 min tests 📄log
✖️ bff6b07 #4 2023-09-21 08:24:38 ~2 min tests 📄log
✔️ bff6b07 #4 2023-09-21 08:25:45 ~3 min android 📦tgz
✔️ bff6b07 #4 2023-09-21 08:25:53 ~3 min ios 📦tgz
✔️ 51857ff #6 2023-09-21 08:37:58 ~1 min linux 📦deb
✖️ 51857ff #5 2023-09-21 08:38:18 ~1 min tests 📄log
✖️ 51857ff #5 2023-09-21 08:38:23 ~1 min tests 📄log
✔️ 51857ff #5 2023-09-21 08:38:50 ~1 min nix-flake 📄log
✔️ 51857ff #5 2023-09-21 08:40:08 ~3 min android 📦tgz
✔️ 51857ff #5 2023-09-21 08:40:35 ~3 min ios 📦tgz
✔️ 0103bc0 #7 2023-10-03 16:04:33 ~1 min linux 📦deb
✔️ 0103bc0 #6 2023-10-03 16:04:58 ~2 min nix-flake 📄log
✖️ 0103bc0 #6 2023-10-03 16:05:42 ~2 min tests 📄log
✖️ 0103bc0 #6 2023-10-03 16:06:13 ~3 min tests 📄log
✔️ 0103bc0 #6 2023-10-03 16:07:04 ~4 min android 📦tgz
✔️ 0103bc0 #6 2023-10-03 16:07:24 ~4 min ios 📦tgz
✖️ 0103bc0 #7 2023-10-03 16:10:54 ~1 min tests 📄log
✖️ 0103bc0 #7 2023-10-04 14:35:55 ~1 min tests 📄log
✔️ a59c8a3 #8 2023-10-05 00:08:43 ~1 min tests 📄log
✔️ a59c8a3 #8 2023-10-05 00:08:49 ~1 min linux 📦deb
✔️ a59c8a3 #7 2023-10-05 00:09:05 ~1 min nix-flake 📄log
✔️ a59c8a3 #8 2023-10-05 00:09:33 ~2 min tests 📄log
✔️ a59c8a3 #7 2023-10-05 00:10:38 ~3 min android 📦tgz
✔️ a59c8a3 #7 2023-10-05 00:12:01 ~4 min ios 📦tgz
✔️ bb415d7 #9 2023-10-05 00:21:28 ~1 min linux 📦deb
✔️ bb415d7 #8 2023-10-05 00:22:21 ~1 min nix-flake 📄log
✔️ bb415d7 #9 2023-10-05 00:22:44 ~2 min tests 📄log
✔️ bb415d7 #9 2023-10-05 00:23:34 ~3 min tests 📄log
✔️ bb415d7 #8 2023-10-05 00:23:43 ~3 min ios 📦tgz
✔️ bb415d7 #8 2023-10-05 00:23:50 ~3 min android 📦tgz
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ c093849 #10 2023-10-05 07:29:32 ~1 min tests 📄log
✔️ c093849 #10 2023-10-05 07:29:35 ~1 min linux 📦deb
✔️ c093849 #9 2023-10-05 07:30:18 ~1 min nix-flake 📄log
✔️ c093849 #10 2023-10-05 07:30:38 ~2 min tests 📄log
✔️ c093849 #9 2023-10-05 07:31:49 ~3 min android 📦tgz
✔️ c093849 #9 2023-10-05 07:32:41 ~4 min ios 📦tgz
✔️ b0275e5 #11 2023-10-13 02:39:16 ~1 min linux 📦deb
✔️ b0275e5 #11 2023-10-13 02:39:32 ~1 min tests 📄log
✔️ b0275e5 #10 2023-10-13 02:39:33 ~1 min nix-flake 📄log
✔️ b0275e5 #11 2023-10-13 02:40:01 ~2 min tests 📄log
✔️ b0275e5 #10 2023-10-13 02:41:51 ~4 min android 📦tgz
✔️ b0275e5 #10 2023-10-13 02:42:19 ~4 min ios 📦tgz

@harsh-98
Copy link
Contributor Author

@jakubgs The tests stages seems to be stuck. There hasn't been any status reported for more than an hr. I have added postgres test that requirees starting postgres db container.

@jakubgs
Copy link
Contributor

jakubgs commented Sep 21, 2023

Fixed.

@harsh-98
Copy link
Contributor Author

@jakubgs Getting this nix error:

+ nix develop --impure .#default --command bash -c 'make test-postgres-with-race'

[2023-09-21T08:23:22.838Z] path '/home/jenkins/workspace/go-waku_prs_race_PR-760' does not contain a 'flake.nix', searching up

[2023-09-21T08:23:22.838Z] error: could not find a flake.nix file

@harsh-98
Copy link
Contributor Author

harsh-98 commented Sep 21, 2023

Previously the store was being tested against sqlite3. After this PR, it will only be tested against postgres. Since persistence is imported in all the examples, i had to add pgx as dependency in all the go.mod.

We can move the test for store to persistence/utils, and use fixtures for testing against both postgres and sqlite. This will also remove the need to add pgx as dependency to all the test. And will be a lot better, we don't need to Register pgx in sql.Driver in persistence store:

persistence - imported in -> sqlite/postgres -imported in -> utils 

@harsh-98 harsh-98 marked this pull request as ready for review September 22, 2023 15:34
waku/persistence/store_test.go Outdated Show resolved Hide resolved
waku/persistence/sqlite/sqlite.go Outdated Show resolved Hide resolved
waku/persistence/mock.go Outdated Show resolved Hide resolved
waku/persistence/store.go Outdated Show resolved Hide resolved
@harsh-98
Copy link
Contributor Author

harsh-98 commented Oct 3, 2023

@jakubgs Getting this nix error:

+ nix develop --impure .#default --command bash -c 'make test-postgres-with-race'
path '/home/jenkins/workspace/go-waku_prs_race_PR-760' does not contain a 'flake.nix', searching up
error: could not find a flake.nix file

ci/Jenkinsfile.tests Outdated Show resolved Hide resolved
ci/Jenkinsfile.tests Outdated Show resolved Hide resolved
ci/Jenkinsfile.tests Outdated Show resolved Hide resolved
Copy link
Contributor

@jakubgs jakubgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks fine.

@harsh-98 harsh-98 requested a review from richard-ramos October 6, 2023 03:23
Copy link
Member

@richard-ramos richard-ramos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool.
if you decide to Squash & Merge the PR, do remember to change the name to match the format (something like feat: postgresql tests), or just use rebase & merge since the individual commit messages are fine :)

@harsh-98 harsh-98 merged commit 2ef7e73 into master Oct 13, 2023
2 checks passed
@harsh-98 harsh-98 deleted the Postgres branch October 13, 2023 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants